﻿<local:DocumentBase x:Class="WPFExcelReport.AB05AV95"
                    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:local="clr-namespace:ReflectionStudio.Components.UserControls;assembly=ReflectionStudio.Core"
                    xmlns:db="clr-namespace:ReflectionStudio.Core.Database;assembly=ReflectionStudio.Core"
                    xmlns:fd="clr-namespace:Labs.Filtering;assembly=ReflectionStudio.Core"
                    FontSize="16"
                    xmlns:wep="clr-namespace:WPFExcelReport"
                     
                    xmlns:ucd="clr-namespace:ReflectionStudio.Controls;assembly=ReflectionStudio.Controls"
                    Loaded="Window_Loaded"
                    Title="后整状态"  
                    HorizontalAlignment="Stretch"  Margin="0,0,0,0"  VerticalAlignment="Stretch"
     >
    <local:DocumentBase.Resources>
        <ucd:Divideby10  x:Key="d10">
        </ucd:Divideby10>
        <ucd:Divideby100  x:Key="d100">
        </ucd:Divideby100>
        <ucd:Divideby1000  x:Key="d1000">
        </ucd:Divideby1000>
        <ucd:GB2312Convert8859P1  x:Key="gb2312">
        </ucd:GB2312Convert8859P1>
        <db:INTEXDataSet x:Key="iNTEXDataSet" />
        <CollectionViewSource x:Key="wASTAMMViewSource" Source="{Binding Path=WASTAMM, Source={StaticResource iNTEXDataSet}}" />
        <CollectionViewSource x:Key="vwABPOS" Source="{Binding Path=ABPOS, Source={StaticResource iNTEXDataSet}}" />
    </local:DocumentBase.Resources>
    <Grid DataContext=""  HorizontalAlignment="Stretch"  Margin="10,10,0,0"  VerticalAlignment="Stretch">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>
        <WrapPanel Grid.Row="0" Name="zoneCommand" Height="34" Margin="0,0,0,6">
            <Button  Content="查询"  Height="23" HorizontalAlignment="Left" Margin="10,5,0,0" Name="btnQuery"
                            VerticalAlignment="Center" Width="75" Click="btnQuery_Click" />
            <Button Content="生成报表"  Height="23" HorizontalAlignment="Left" Margin="10,5,0,0" Name="btnReport"
                            VerticalAlignment="Top" Width="75"
                                Click="btnReport_Click"
                                />
            <Button Content="更新数据"  Height="23" HorizontalAlignment="Left" Margin="10,5,0,0" Name="btnUpdate"
                            VerticalAlignment="Top" Width="75"
                                Click="btnUpdate_Click"
                                />
        </WrapPanel>
        <StackPanel Grid.Row="1" Name="MainPanel" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
            <Expander Header="查询条件" Name="zoneQueryCond"  IsExpanded="True" ExpandDirection="Up"
                      HorizontalAlignment="Stretch"  Margin="10,10,0,0"  VerticalAlignment="Stretch" Background="#FFF5F2F2">
                <Grid >
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                    </Grid.RowDefinitions>
                    <StackPanel Grid.Row="1" >
                        <WrapPanel>
                            <CheckBox Content="完成单"  Name="txtERLKZ" Margin="20,0,0,0" Background="WhiteSmoke" VerticalAlignment="Stretch"  />
                            <CheckBox Content="按批次"  Name="txtBYLOT" Margin="20,0,0,0" Background="WhiteSmoke" VerticalAlignment="Stretch" IsChecked="True"  />
                        </WrapPanel>
                        <WrapPanel>
                            <Label Content="生产单号码:"    Width="120" HorizontalAlignment="Left" Margin="3"  FontSize="18" VerticalAlignment="Center" />
                            <TextBox Name="txtKRS" Width="30" HorizontalAlignment="Left" Background="Pink" FontSize="18" Text="" KeyDown="txt_KeyDown" CharacterCasing="Upper" AcceptsTab="False" MaxLength="2" />
                            <TextBox Name="txtLFD" Width="90" HorizontalAlignment="Left" Background="Beige" Text="" FontSize="18" Height="30" KeyDown="txt_KeyDown" AcceptsTab="False" CharacterCasing="Upper" MaxLength="6" Panel.ZIndex="1" />
                            <TextBox Name="txtPOS" Width="40" HorizontalAlignment="Left" Background="Pink" FontSize="18" Text="" Height="30" KeyDown="txt_KeyDown" AcceptsTab="False" MaxLength="3" Panel.ZIndex="2" />
                            <TextBox Name="txtLOT" Width="60" HorizontalAlignment="Left" Background="YellowGreen" FontSize="18" Text="" Height="30" KeyDown="txt_KeyDown" AcceptsTab="False" MaxLength="3" Panel.ZIndex="2" />
                            <Label Content="品种:"  Width="60"  HorizontalAlignment="Left" Margin="3"  FontSize="18" VerticalAlignment="Center" />
                            <TextBox Name="txtArticle" Text="{Binding ElementName=wAARTComboBox, Path=Text}" Width="131"  HorizontalAlignment="Left" Background="Azure" CharacterCasing="Upper" AcceptsTab="False" MaxLength="20" Panel.ZIndex="3" />
                            <Label Content="外加工厂编号："  HorizontalAlignment="Left"     VerticalAlignment="Stretch"  />
                            <TextBox Name="txtFACTORY" Width="112" HorizontalAlignment="Left" Background="Beige" Text=""  
                                     KeyDown="txt_KeyDown" AcceptsTab="False" CharacterCasing="Upper" MaxLength="6" Panel.ZIndex="1" /> 
                        </WrapPanel>
                        <Grid DataContext="{StaticResource wASTAMMViewSource}" HorizontalAlignment="Left" Margin="10,10,0,0" Name="grid1" VerticalAlignment="Top">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto" />
                                <ColumnDefinition Width="Auto" />
                            </Grid.ColumnDefinitions>
                            <Grid.RowDefinitions>
                                <RowDefinition Height="Auto" />
                            </Grid.RowDefinitions>
                            <Label Content="品种选择:"  Width="120" FontSize="18" Grid.Column="0" Grid.Row="0" HorizontalAlignment="Left" Margin="3" VerticalAlignment="Center" />
                            <ComboBox DisplayMemberPath="WAART"
                                      SelectedValuePath="WAART"
                                      FontSize="18"
                                      IsEditable="True"
                                      IsTextSearchEnabled="True"
                                      IsTextSearchCaseSensitive="False"
                                      Background="AliceBlue"
                                      Grid.Column="1" Height="30" HorizontalAlignment="Left" ItemsSource="{Binding}" Margin="3,3,0,3" Name="wAARTComboBox" VerticalAlignment="Center" Width="167">
                                <ComboBox.ItemsPanel>
                                    <ItemsPanelTemplate>
                                        <VirtualizingStackPanel />
                                    </ItemsPanelTemplate>
                                </ComboBox.ItemsPanel>
                            </ComboBox>
                        </Grid>
                        <WrapPanel>
                            <Label Content="发坯布时间"  FontSize="18" Height="30" HorizontalAlignment="Left" Margin="10,10,0,0" Name="label1" 
                       VerticalAlignment="Top" Width="120"  />
                            <TextBox Name="gsendstartdate"  Height="30"  Width="90" HorizontalAlignment="Left" Background="Azure" FontSize="16" MaxLength="8" Panel.ZIndex="4" />
                            <DatePicker Grid.Column="1" HorizontalAlignment="Left" Margin="10,10,0,0" Name="gsendstartDateChooser" VerticalAlignment="Top" Width="130" 
                                SelectedDateChanged="gsendstartDateChooser_SelectedDateChanged"/>
                            <Label  Content="至"  FontSize="18" Height="30" HorizontalAlignment="Left" Margin="10,10,0,0" Name="label2" VerticalAlignment="Top" Width="29" />
                            <TextBlock Name="gsendenddate" Height="30"  Width="100" Background="Azure" FontSize="16" Text="" />
                            <DatePicker Grid.Column="1" HorizontalAlignment="Left" Margin="10,10,0,0" Name="gsendendDateChooser" VerticalAlignment="Top" Width="130" 
                                SelectedDateChanged="gsendendDateChooser_SelectedDateChanged"/>
                        </WrapPanel>
                    </StackPanel>
                </Grid>
            </Expander>
            <Expander Header="数据" Name="zoneDataList"  IsExpanded="True"
                      HorizontalAlignment="Stretch"  Margin="10,10,0,0"  VerticalAlignment="Stretch">
                <fd:FilteringDataGrid AutoGenerateColumns="False" EnableRowVirtualization="True"  
                                              ItemsSource="{Binding Source={StaticResource vwABPOS}}" 
                                              x:Name="dlgABPOS" 
                                                 CanUserReorderColumns="True"  
                                             CanUserResizeRows="True"
                                              CanUserSortColumns="True"
                                              IsFilteringCaseSensitive="False" 
                                              Width="1000"
                                               Height="400"
                                              ScrollViewer.HorizontalScrollBarVisibility="Visible"
                                              ScrollViewer.VerticalScrollBarVisibility="Visible"
                                              SelectionChanged="dlgABPOS_SelectionChanged"
                                              >
                    <DataGrid.Columns> 
                        <!---DataGridTextColumn Binding="{Binding Path=VKPAUFKRS}" Header="前缀" Width="SizeToCells" /-->
                        <!--DataGridTextColumn Binding="{Binding Path=VKPAUFLFD}" Header="销售单号" Width="SizeToCells" /-->
                        <!--DataGridTextColumn Binding="{Binding Path=VKPAUFPOS}" Header="行号" Width="SizeToCells" />
                        <DataGridTextColumn Binding="{Binding Path=FORDERNUM}" Header="后整厂加工单号" Width="SizeToCells" />                                                
                        <DataGridTextColumn Binding="{Binding Path=ABARESQTY, Converter={StaticResource ResourceKey=d100}}" Header="留位数量" Width="SizeToHeader" />                                           
                        <DataGridTextColumn Binding="{Binding Path=FFINISH,  Converter={StaticResource ResourceKey=gb2312}}" Header="后整理工艺" Width="SizeToHeader" />
                        <DataGridTextColumn  Binding="{Binding Path=REMARK}" Header="备注" Width="SizeToCells" />
                        <DataGridTextColumn  Binding="{Binding Path=ABPSOLLMENGE1, Converter={StaticResource ResourceKey=d100}}" Header="生产单数量" Width="SizeToHeader" />
                        <DataGridTextColumn Binding="{Binding Path=ABPRESMGE, Converter={StaticResource ResourceKey=d100}}" Header="计划数量" Width="SizeToHeader" />
                        <DataGridTextColumn  Binding="{Binding Path=ABPRESSTK, Converter={StaticResource ResourceKey=d100}}" Header="计划匹数" Width="SizeToHeader" />
                        <DataGridTextColumn  Binding="{Binding Path=ABPZUGET, Converter={StaticResource ResourceKey=d100}}" Header="留位数量" Width="SizeToHeader" />
                        <DataGridTextColumn  Binding="{Binding Path=ABPZUGSTK}" Header="留位匹数" Width="SizeToHeader" />
                        <DataGridTextColumn Binding="{Binding Path=KDKUNDNA,  Converter={StaticResource ResourceKey=gb2312}}" Header="客户" Width="SizeToCells" /-->
                        <DataGridTextColumn Binding="{Binding Path=FPRODUCER}"  Header="后整厂" MinWidth="120" Width="SizeToCells"/>
                        <DataGridTextColumn Binding="{Binding Path=GPRODUCER}" Header="织布厂" MinWidth="120" Width="SizeToCells"/>
                        <DataGridTextColumn Binding="{Binding Path=GISSUEDATE}" Header="出坯日期" MinWidth="80" Width="SizeToCells"/>
                        <DataGridTextColumn  Binding="{Binding Path=ARTICLE}" Header="品名" MinWidth="140" Width="SizeToCells" />
                        <DataGridTextColumn Binding="{Binding Path=SIZEBATCHNO}" Header="缸号" MinWidth="80" Width="SizeToCells"/>
                        <DataGridTextColumn  Binding="{Binding Path=ABPLOT}" Header="后整单号" MinWidth="100" Width="SizeToCells"/>
                        <DataGridTextColumn Binding="{Binding Path=GPCNUM}" Header="坯(匹)" MinWidth="60" Width="SizeToCells"  />
                        <DataGridTextColumn Binding="{Binding Path=GMETER}" Header="坯(米)" MinWidth="60" Width="SizeToCells"  />
                        <DataGridTextColumn Binding="{Binding Path=ABPLIEFDAT}" Header="预计完成" MinWidth="80" Width="SizeToCells"  />
                        <DataGridTextColumn Binding="{Binding Path=FGETDATE}" Header="实际回货" MinWidth="80" Width="SizeToCells" />
                        <DataGridTextColumn Binding="{Binding Path=FNGRDIFF}" Header="延迟"  MinWidth="50" Width="SizeToCells" />
                        <DataGridTextColumn Binding="{Binding Path=FPCNUM}" Header="成(匹)" MinWidth="60" Width="SizeToCells" />
                        <DataGridTextColumn  Binding="{Binding Path=FMETER}" Header="成(米)" MinWidth="60" Width="SizeToCells" />
                        <DataGridTextColumn Binding="{Binding Path=FGWASTAGE}" Header="损耗" MinWidth="50" Width="SizeToCells"  />
                        <DataGridTextColumn Binding="{Binding Path=ABPBESCHICH}" Header="后整理" MinWidth="60" Width="SizeToCells" />
                    </DataGrid.Columns>
                </fd:FilteringDataGrid>
            </Expander>
        </StackPanel>
    </Grid>    
</local:DocumentBase>
